const up: Object = {
  state: {
    //   添加
    addData: {},
    pagedata: [],
    // 编辑框
    dialogVisible: false,
    // 添加
    addhome: false,
    navBool: false,
    dialogFormVisible: false,
    uplistData: {},
    listdata: [],
  },
  getters: {
  },
  mutations: {
    setPagedata(state: any, payload: any) {
      state.pagedata = payload;
    },
    // 添加
    SET_NAV(state: any) {
      state.addhome = !state.addhome;
    },
    // 修改编辑弹窗显示状态
    changeDialog(state: any) {
      state.dialogVisible = !state.dialogVisible;
    },
    // 编辑框信息
    showEdit(state: any, obj: any) {
      state.editForm = JSON.parse(JSON.stringify(obj));
    },
    // 修改state的数据
    SET_NAVBOOL(state: any) {
      state.navBool = !state.navBool;
    },
    SET_DIALOG(state: any, paylog: any) {
      state.dialogFormVisible = !state.dialogFormVisible;

      state.uplistData = paylog;
      console.log(state.uplistData);
    },
    DIALOG(state: any) {
      state.dialogFormVisible = !state.dialogFormVisible;
      window.location.reload();
    },
    // 添加
    DATA(state: any, obj: any) {
      state.addData = JSON.parse(JSON.stringify(obj));
    },
    LISTDATA(state: any, paylog: any) {
      state.listdata = paylog;
    },

  },
  actions: {
    CHANGEDIALOG(context: any) {
      context.commit('changeDialog');
    },
  },

};
export default up;

// import { createStore } from 'vuex';
// import VuexPersister from 'vuex-persister';

// const vuexPersister = new VuexPersister({
//     // ...your options
// });

// export default createStore({
//     state: {
//         //添加
//         addData: {},
//         pagedata: [],
//         // 编辑框
//         dialogVisible: false,
//         //添加
//         addhome: false,
//         navBool: false,
//         dialogFormVisible: false,
//         uplistData: {},
//         listdata: []

//     },
//     plugins: [vuexPersister.persist],
//     getters: {
//     },
//     mutations: {
//
//     },
//     modules: {

//     },
// });
